package cn.wzvtcsoft.sys.entity;

import cn.wzvtcsoft.base.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Set;

@Setter
@Getter
@Entity(name = "sys_user")
public class User extends BaseEntity {

  private Long parentId;

  private String name;

  private String password;

  private String mobile;

  private String address;

  @Column(precision = 30, scale = 18)
  private BigDecimal perAmount;

  private Integer state;

  @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true)
  private Set<UserRole> userRoles;

}
